home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: H E L P
- Date: 3 Apr 1996 16:36:55 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4juui7$a8a@solutions.solon.com>
- References: <N.040296.013047.18@DynamicPPP-185.HIP.CAM.ORG> <Pine.A32.3.91.960402135001.121719B-100000@green.weeg.uiowa.edu> <4js6jh$ndr@solutions.solon.com> <DpAx1J.4n9@iquest.net>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <DpAx1J.4n9@iquest.net>, Doug Miller <dlmiller@iquest.net> wrote:
- >Obviously you didn't read what he wrote. To satisfy the conditions of the
- >task as he stated it, he would need an infinite number of ifs ("whatever
- >number I enter..."). I saw nothing in his statement of the task that placed
- >any limits of any sort on the number -- thus, he *does* need a loop.
-
- Well, assuming he's using integers to represent the age, the space isn't
- *infinite*. It's just *large*. We can ignore negative numbers (after all, we
- can't print a negative number of smileys), and we can thus get away with only
- INT_MAX ifs.
-
- My assumption had also been that it would be a real person's age, at which
- point (barring the Wandering Jew) we have only about 150 cases to worry about.
-
- Now, it would be moronically stupid to do this, but you *could* do it.
-
- For extra credit, prove that you can do at least 15-bit numbers within
- numbers with the 15 levels of nesting guaranteed by the standard, and
- point out the limitation you'd run into, and at least one way around it
- without relying on loops.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-